/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ht3algoritmos;

/**
 *
 * @author jose
 */
import java.util.Random;
import java.io.*;
public class GenerarNumeros {
    public void genNum(){
        try{
                // Create file 
            FileWriter fstream = new FileWriter("numeros.txt");
            BufferedWriter out = new BufferedWriter(fstream);
            Random numeroAleatorio =new Random(); 
            for(int i=0; i<= 2001;i++){    
                String num = numeroAleatorio.nextInt()+"\n";
                out.write(num);
                }
                //Close the output stream
                out.close();
                }
            catch (Exception e){//Catch exception if any
                    System.err.println("Error: " + e.getMessage());
                }

    }
}
